package regexp.exercise;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2024-06-16
 * Time:17:57
 */
public class Exercise2 {
    public static void main(String[] args) {
        String content = "123";
        content = "12.01";
        content = "-1";
        content = "0.01";
        content = "01";
        String regex = "^[+-]?([1-9]\\d*|0)(\\.\\d+)?";
        if (content.matches(regex)){
            System.out.println("match on integral or float");
        } else {
            System.out.println("failed");
        }
    }
}
